package com.dlc.beijingrfid.net.bean;

import android.os.Parcel;
import android.os.Parcelable;
import com.dlc.beijingrfid.model.intfc.ProductStatusList;
import com.google.gson.annotations.Expose;
import java.util.List;

/**
 * Created by John on 2017/7/25.
 */

public class RFIDListBean {
    /**
     * code : 1
     * msg : 查询成功
     * data : {"total":3,"totalpage":1,"page":1,"pages":"","list":[{"id":"3","company_id":"0","cardno":"1231","goods_id":"1","warehouse_id":"1","ware_frame_id":"1","washed":"0","title":"纯棉毛巾12*12","category_id":"1","spec_id":"1","cost":"1.00","category":"毛巾","spec":"12*12","warehouse":"1号仓库"},{"id":"2","company_id":"0","cardno":"1233","goods_id":"1","warehouse_id":"1","ware_frame_id":"2","washed":"0","title":"纯棉毛巾12*12","category_id":"1","spec_id":"1","cost":"1.00","category":"毛巾","spec":"12*12","warehouse":"1号仓库"},{"id":"1","company_id":"0","cardno":"1232","goods_id":"1","warehouse_id":"1","ware_frame_id":"1","washed":"0","title":"纯棉毛巾12*12","category_id":"1","spec_id":"1","cost":"1.00","category":"毛巾","spec":"12*12","warehouse":"1号仓库"}]}
     */

    public int code;
    public String msg;
    public DataBean data;

    public static class DataBean {
        /**
         * total : 3
         * totalpage : 1
         * page : 1
         * pages :
         * list : [{"id":"3","company_id":"0","cardno":"1231","goods_id":"1","warehouse_id":"1","ware_frame_id":"1","washed":"0","title":"纯棉毛巾12*12","category_id":"1","spec_id":"1","cost":"1.00","category":"毛巾","spec":"12*12","warehouse":"1号仓库"},{"id":"2","company_id":"0","cardno":"1233","goods_id":"1","warehouse_id":"1","ware_frame_id":"2","washed":"0","title":"纯棉毛巾12*12","category_id":"1","spec_id":"1","cost":"1.00","category":"毛巾","spec":"12*12","warehouse":"1号仓库"},{"id":"1","company_id":"0","cardno":"1232","goods_id":"1","warehouse_id":"1","ware_frame_id":"1","washed":"0","title":"纯棉毛巾12*12","category_id":"1","spec_id":"1","cost":"1.00","category":"毛巾","spec":"12*12","warehouse":"1号仓库"}]
         */

        public int total;
        public int totalpage;
        public int page;
        public String pages;
        public List<ListBean> list;

        public static class ListBean implements ProductStatusList, Parcelable {
            /**
             * id : 3
             * company_id : 0
             * cardno : 1231
             * goods_id : 1
             * warehouse_id : 1
             * ware_frame_id : 1
             * washed : 0
             * title : 纯棉毛巾12*12
             * category_id : 1
             * spec_id : 1
             * cost : 1.00
             * category : 毛巾
             * spec : 12*12
             * warehouse : 1号仓库
             */

            public int id;
            public String company_id;
            public String cardno;
            public int goods_id;
            public int warehouse_id;
            public int ware_frame_id;
            public int washed;
            public String title;
            public int category_id;
            public int spec_id;
            public String cost;
            public String category;
            public String status;
            public String spec;
            public String warehouse;
            public int state = 0;

            @Expose(serialize = false, deserialize = false) public boolean unbound;

            @Override
            public String getRFID() {
                return cardno;
            }

            @Override
            public String getName() {
                return title;
            }

            public String getStatus() {
                return status;
            }
            @Override
            public String getSpec() {
                return spec;
            }

            @Override
            public String getWhere() {
                return warehouse;
            }

            @Override
            public boolean isUnbound() {
                return unbound;
            }

            @Override
            public void setUnbound(boolean unbound) {
                this.unbound = unbound;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeInt(this.id);
                dest.writeString(this.company_id);
                dest.writeString(this.cardno);
                dest.writeInt(this.goods_id);
                dest.writeInt(this.warehouse_id);
                dest.writeInt(this.ware_frame_id);
                dest.writeInt(this.washed);
                dest.writeString(this.title);
                dest.writeString(this.status);
                dest.writeInt(this.category_id);
                dest.writeInt(this.spec_id);
                dest.writeString(this.cost);
                dest.writeString(this.category);
                dest.writeString(this.spec);
                dest.writeString(this.warehouse);
            }

            public ListBean() {
            }

            protected ListBean(Parcel in) {
                this.id = in.readInt();
                this.company_id = in.readString();
                this.cardno = in.readString();
                this.goods_id = in.readInt();
                this.warehouse_id = in.readInt();
                this.ware_frame_id = in.readInt();
                this.washed = in.readInt();
                this.title = in.readString();
                this.status = in.readString();
                this.category_id = in.readInt();
                this.spec_id = in.readInt();
                this.cost = in.readString();
                this.category = in.readString();
                this.spec = in.readString();
                this.warehouse = in.readString();
            }

            public static final Creator<ListBean> CREATOR = new Creator<ListBean>() {
                @Override
                public ListBean createFromParcel(Parcel source) {
                    return new ListBean(source);
                }

                @Override
                public ListBean[] newArray(int size) {
                    return new ListBean[size];
                }
            };
        }
    }
}
